package com.sunwayworld.basemodule.samplemanage.sample.resource;

import com.sunwayworld.basemodule.samplemanage.sample.bean.LimsSampleBean;
import com.sunwayworld.framework.data.page.Page;
import com.sunwayworld.framework.log.annotation.Log;
import com.sunwayworld.framework.log.annotation.LogType;
import com.sunwayworld.framework.restful.data.RestJsonWrapperBean;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import com.sunwayworld.basemodule.samplemanage.sample.bean.LimsSampleDerivativeBean;
import com.sunwayworld.basemodule.samplemanage.sample.service.LimsSampleDerivativeService;
import com.sunwayworld.framework.support.base.resource.GenericResource;
import org.springframework.web.bind.annotation.RequestMethod;

@RequestMapping("/secure/baseline/samplemanage/sample-derivatives")
public interface LimsSampleDerivativeResource extends GenericResource<LimsSampleDerivativeService, LimsSampleDerivativeBean, Long> {

    @RequestMapping(value = "/runs/{runId}/queries", method = RequestMethod.POST)
    Page<LimsSampleBean> selectDerivativeInRunPagination(@PathVariable Long runId, RestJsonWrapperBean wrapperBean);

    @RequestMapping(value = "/tasks/{taskId}/queries", method = RequestMethod.POST)
    Page<LimsSampleBean> selectDerivativeInTaskPagination(@PathVariable Long taskId, RestJsonWrapperBean wrapperBean);

    @Log(value = "添加衍生物", type = LogType.INSERT)
    @RequestMapping(value = "/derivatives", method = RequestMethod.POST)
    void insertDerivative(RestJsonWrapperBean wrapper);

    @Log(value = "衍生物添加的tab2，批量添加衍生物", type = LogType.INSERT)
    @RequestMapping(value = "/derivatives-multi", method = RequestMethod.POST)
    void insertDerivativesMulti(RestJsonWrapperBean wrapper);
}
